import request from "@/utils/request";
import { AxiosPromise } from "axios";
import { CaptchaResult, LoginData, LoginResult } from "./types";

/**
 * 登录API
 *
 * @param data {LoginData}
 * @returns
 */
export function loginApi(data: LoginData): AxiosPromise<LoginResult> {
  return request({
    url: "/api/work/login", //"/api/v1/auth/login",
    method: "post",
    data: data,
  });
}

/**
 * 注销API
 */
export function logoutApi() {
  // return request({
  //   url: "/api/v1/auth/logout",
  //   method: "delete",
  // });
  return new Promise<void>((resolve) => {
    resolve();
  });
}

/**
 * 获取验证码
 */
// export function getCaptchaApi(): AxiosPromise<CaptchaResult> {
//   return request({
//     url: "/api/v1/auth/captcha",
//     method: "get",
//   });
// }
